package com.dhcc.sds.busi.controller;

import com.alibaba.fastjson.JSONArray;
import com.dhcc.cdc.busi.service.ICdcHospitalService;
import com.dhcc.cdc.busi.service.ICdcLocationService;
import com.dhcc.cdc.busi.service.ICdcUserService;
import com.dhcc.sds.base.service.ISdsCommonService;
import com.dhcc.sds.base.service.ISdsQcentityService;
import com.dhcc.sds.busi.service.IAnalysisImportantSdsIndstaService;
import com.dhcc.sds.busi.service.ISdsQcincaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * 单病种重点质量指标统计
 *
 * @ClassName: AnalysisImportantSdsIndexstaController
 * @Description: TODO
 * @author sunyj
 * @date 2024-04-19 10:09:15
 */
@Controller
@RequestMapping("${sys.backendPath}/analysis/importantindexstat")
public class AnalysisImportantSdsIndexstaController {

    private String PREFIX = "/backend/sds/importantindexstat/";

    @Autowired
    private ICdcHospitalService cdcHospitalService;

    @Autowired
    private ICdcLocationService cdcLocationService;

    @Autowired
    private ISdsQcentityService sdsQcentityService;

    @Autowired
    private IAnalysisImportantSdsIndstaService analysisImportantSdsIndstaService;

    @Autowired
    private ISdsQcincaseService sdsQcincaseService;

    @Autowired
    private ISdsCommonService sdsCommonService;
    @Autowired
    private ICdcUserService cdcUserService;

    /**
     * @Description: 单病种重点质量指标统计
     * @Title:
     * @author: sunyj
     * @date:2024-04-19 10:09:15
     */
    @RequestMapping("")
    public String index(Model model) {
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //加载用户关联科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //获取病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();
        model.addAttribute("officeMap",officMap);
        model.addAttribute("departMap",departMap);
        model.addAttribute("entityMap",entityMap);
        return PREFIX + "importantindexstat.html";
    }

    /**
     * @Description: 查询单病种指标统计表格数据
     * @Title: selectIndexTableData
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectIndexTableData")
    @ResponseBody
    public Object selectIndexTableData(@RequestParam Map<String, Object> params) {
        return analysisImportantSdsIndstaService.selectIndexTableData(params);
    }
}
